//package com.fingard.dsp.bank.directbank.ccb04;
//
//import com.fingard.dsp.bank.directbank.ccb04.util.Des3;
//import com.fingard.dsp.bank.directbank.ccb04.util.RSAHelper;
//import org.bouncycastle.util.encoders.Base64;
//
//import com.fingard.constant.Format;
//import com.fingard.dsp.bank.directbank.bankInterface.IRealTime;
//import com.fingard.dsp.bank.reqrespobj.single.ReqQrySingle;
//import com.fingard.dsp.bank.reqrespobj.single.ReqSingle;
//import com.fingard.dsp.bank.reqrespobj.single.RetAtsSingle;
//import com.fingard.dsp.bank.reqrespobj.single.detail.RetAtsSglDetail;
//import com.fingard.io.FileHelper;
//import com.fingard.text.Base64Helper;
//import com.fingard.text.StringHelper;
//import com.fingard.xml.XmlTextReader;
//import com.fingard.xml.XmlTextWriter;
//
//import java.io.File;
//import java.math.BigDecimal;
//import java.net.URLEncoder;
//import java.util.Date;
//import java.util.HashMap;
//
//import static com.fingard.io.FileHelper.existFile;
//import static com.fingard.io.FileHelper.writeFile;
//import static com.fingard.text.StringHelper.trimEndFileSp;
//
//public class CCB04RealTime extends CCB04Base implements IRealTime {
//    @Override
//    public RetAtsSingle d_9108_RealTimeRec(ReqSingle p_req9108) throws Exception {
//        RetAtsSingle retAts = new RetAtsSingle(p_req9108.reqHeader);
//        //retAts.writeStart();
//        RetAtsSglDetail detail = new RetAtsSglDetail();
//        try {
//            WriteBankLogLn("进入单笔全额扣款处理");
//            //查询之前做登录操作 下载公钥密钥 进行3des加密 和md5withRSA签名 byte[]数据和String进行base64互转
//            getBnkToken();
////            if (triDesKeys != null && triDesKeys.length != 1024) {
//            if (StringHelper.hasAnyChar(bankFront.token)) {
//                if (new File(String.format("%1$s%2$s_BnkPubKey.txt", strtmpFile, bankFront.org)).exists()) {
//                    if (!"".equals(bankFront.loginFlag) && !"false".equals(bankFront.loginFlag)) {
//                        StringBuilder FileContent = new StringBuilder();
//                        FileContent.append(String.format("%s|%s|%s|%s|%s|%s|%s|%s|%s|\r\n", "序号", "账号", "户名", "金额", "跨行标志", "人民银行联行号", "多方协议号", "摘要", "备注"));
//                        int count = 0;
//                        BigDecimal amount = BigDecimal.ZERO;
//
//                        count++;
//                        String postScript = count + "";
//                        String payAct = p_req9108.singleDetail.payAct;  //付款方账号
//                        String recName = p_req9108.singleDetail.payName;
//                        String payAmount = p_req9108.singleDetail.payAmount;
////                        String sameBnkFlag = p_req9108.singleDetail.recBankName.contains("中国建设银行") ? "0" : "1";   // 0：同行，1：跨行
//                        String sameBnkFlag = "0"; //中国建设银行 0：同行，1：跨行(不支持跨行代扣)
////                        if ("0".equals(p_req9108.singleDetail.sameBnk)) {
////                            //ATS 0表示跨行
////                            sameBnkFlag = "1";
////                        } else {
////                            sameBnkFlag = "0";
////                        }
//                        String cnapsCode = "";
//                        String multiProtocol = "";
//
//                        if ("1".equals(sameBnkFlag)) {
//                            cnapsCode = "";         //统一取清算行号
//                            multiProtocol = getBankConfig().getValueAsString("multiProtocol");
//                        }
//                        amount = amount.add(new BigDecimal(payAmount));
//                        String summary = p_req9108.singleDetail.abstractATS;
//                        String memo = p_req9108.singleDetail.memo;
////                        String summary = p_req9108.singleDetail.memo;// 摘要
////                        String memo = p_req9108.singleDetail.abstractATS;// 备注存入批次明细流水号，供批次明细查询时作为对账码返回ATS
//                        FileContent.append(String.format("%s|%s|%s|%s|%s|%s|%s|%s|%s|", postScript, payAct, recName, payAmount, sameBnkFlag, cnapsCode, multiProtocol, summary, memo));
//
//                        WriteBankLogLn("发送银行文件：" + FileContent);
//                        String FilePath = getBankConfig().getValueAsString("BatLogs");
//                        FilePath = trimEndFileSp(FilePath) + File.separator;
//                        Date d = new Date();
//                        String date = Format.Date8Format.format(d);
//                        String BatchFileName = p_req9108.singleDetail.askNumber + ".txt";
//                        String FullPath = FilePath + date + File.separator + BatchFileName;
//                        if (!existFile(FullPath)) {
//                            writeFile(FullPath, FileContent.toString(), "GBK");
//                        }
//                        WriteBankLogLn("文件夹放置位置：" + FullPath);
//                        //POST 参数 1: chanl_cust_no=电子银行合约编号
//                        String chanl_cust_no = getBankConfig().getValueAsString("CustNo");
//
//                        //POST 参数 2：filename=文件名（不含路径的文件名，DESede(3DES)对称密钥加密）
//                        byte[] tmpName = Des3.encryptMode(Base64Helper.decode(bankFront.token), BatchFileName.getBytes("GBK"));
//                        tmpName = Base64.encode(tmpName);
//                        String filename = new String(tmpName);
//
//                        //POST 参数 3：signature=数字签名（对文件名作的数字签名）
//                        String priKey = FileHelper.readFileText(strtmpFile + chanl_cust_no + "_prikey.txt", getCharset());
//                        String signature = RSAHelper.sign(BatchFileName, priKey, getCharset());//MD5withRSA(batchFileName);
//
//                        //POST 参数 4：data=文件内容（DESede(3DES)对称密钥加密）
//                        byte[] tmpData = Des3.encryptMode(Base64Helper.decode(bankFront.token), FileContent.toString().getBytes("GBK"));
//                        tmpData = Base64.encode(tmpData);
//                        String data = new String(tmpData);
//
//                        //POST 参数 5：dirflag=是否上传至子目录（0-否，1-是，DESede(3DES)对称密钥加密
//                        byte[] tmpZero = Des3.encryptMode(Base64Helper.decode(bankFront.token), "0".getBytes("GBK"));
//                        tmpZero = Base64.encode(tmpZero);
//                        String dirflag = new String(tmpZero);
//
//                        StringBuilder sb = new StringBuilder();
//                        sb.append("chanl_cust_no=" + URLEncoder.encode(chanl_cust_no, "gbk"));
//                        sb.append("&filename=" + URLEncoder.encode(filename, "gbk"));
//                        sb.append("&signature=" + URLEncoder.encode(signature, "gbk"));
//                        sb.append("&data=" + URLEncoder.encode(data, "gbk"));
//                        sb.append("&dirflag=" + URLEncoder.encode(dirflag, "gbk"));
//
//                        String[] PostRet = UploadFileByHttpPost(sb);
//
//                        String BatchResult = IsBatchValid(PostRet[1]);
//
//                        String BatchFileServerName = "";
//                        if (!StringHelper.isNullOrEmpty(BatchResult)) {
//                            String[] SplitedResult = BatchResult.split("\\|");
//                            if ("SUCCESS".equals(SplitedResult[0])) {
//                                BatchFileServerName = SplitedResult[3];
//                            }
//                        }
//
//
//                        //赋值通用参数
//                        txCode = "P1CLP1051";
//                        reqSeqID = p_req9108.singleDetail.askNumber;
//                        XmlTextWriter xmlWriter = new XmlTextWriter();//发银行报文的XML对象
//                        XmlTextWriter xmlWriterWithoutCDATA = new XmlTextWriter();//发银行报文的XML对象
//                        //写入通用的头部节点
//                        writeCommonHeaderWithoutCDATA(xmlWriterWithoutCDATA);
//                        xmlWriterWithoutCDATA.writeStartElement("request");
//                        String CustNo = bankFront.org;
//                        String projectUseId="";
//                        String projectID = getBankConfig().getMapValueByKey("projectIDMapping", p_req9108.reqHeader.transType + "-" + p_req9108.singleDetail.recAct + "-" + p_req9108.singleDetail.sameBnk);
//                        if (StringHelper.isNullOrEmpty(projectID)) {
//                            projectID = getBankConfig().getMapValueByKey("projectIDMapping", p_req9108.reqHeader.transType + "-" + p_req9108.singleDetail.recAct);
//                        }
//                        if (StringHelper.isNullOrEmpty(projectID)) {
//                            projectID = getBankConfig().getMapValueByKey("projectIDMapping", p_req9108.reqHeader.transType);
//                        }
//                        if (StringHelper.isNullOrEmpty(projectID)) {
////                            projectID = getBankConfig().getSetValue("projectID", "", "9108");
//                            HashMap<String, String> prjMap = getBankConfig().getMapAdvanceValues("prjMapping" + p_req9108.reqHeader.transType, new String[]{"act"}, new String[]{"prjID", "useID"}, new String[]{p_req9108.singleDetail.recAct}, false);
//                            if (prjMap != null && prjMap.size() > 0) {
//
//                                if (prjMap.containsKey("prjID") && StringHelper.hasAnyChar(prjMap.get("prjID"))) {
//                                    projectID = prjMap.get("prjID");
//                                }
//                                if (prjMap.containsKey("useID") && StringHelper.hasAnyChar(prjMap.get("useID"))) {
//                                    projectUseId = prjMap.get("useID");
//                                }
//                            }
//                        }
//                        if(StringHelper.isNullOrEmpty(projectUseId)){
//                            projectUseId="zlds00001";
//                        }
//                        String opertorID = getBankConfig().getSetValue("opertorID", "", "9108");
//                        xmlWriterWithoutCDATA.writeElementString("ASPD_ECD", "00000886");
//                        xmlWriterWithoutCDATA.writeElementString("Txn_SN", p_req9108.singleDetail.askNumber);
//                        xmlWriterWithoutCDATA.writeElementString("EBnk_SvAr_ID", CustNo);
//                        xmlWriterWithoutCDATA.writeElementString("Entrst_Prj_ID", projectID);//钞汇代码 1钞人民币 2汇外币
//                        xmlWriterWithoutCDATA.writeElementString("Prj_Use_ID", projectUseId);
//                        xmlWriterWithoutCDATA.writeElementString("EtrUnt_AccNo", p_req9108.singleDetail.recAct);
//                        xmlWriterWithoutCDATA.writeElementString("TDP_ID", opertorID);
//                        xmlWriterWithoutCDATA.writeElementString("TDP_Nm", "");
//                        xmlWriterWithoutCDATA.writeElementString("CntprtAcc", p_req9108.singleDetail.payAct);
//                        xmlWriterWithoutCDATA.writeElementString("Cntrprt_AccNm", p_req9108.singleDetail.payName);
//                        xmlWriterWithoutCDATA.writeElementString("IwBk_BrNo", "");
//                        xmlWriterWithoutCDATA.writeElementString("IwBk_BkNm", "");
//                        xmlWriterWithoutCDATA.writeElementString("MltltAgrm_No", "");
//                        xmlWriterWithoutCDATA.writeElementString("CCY_ID", "156");
//                        xmlWriterWithoutCDATA.writeElementString("Orig_File_Nm", BatchFileName);
//                        xmlWriterWithoutCDATA.writeElementString("SRP_TxnAmt", amount + "");
//                        xmlWriterWithoutCDATA.writeElementString("SCSP_Smy_Dsc", "");
//                        xmlWriterWithoutCDATA.writeElementString("Rvw_Ind", "1");
//                        xmlWriterWithoutCDATA.writeElementString("TAmt", amount + "");
//                        xmlWriterWithoutCDATA.writeElementString("TDnum", "1");  //单笔
//                        xmlWriterWithoutCDATA.writeElementString("VCHR_TP_CODE", "0");   //0单笔 1批量
//                        xmlWriterWithoutCDATA.writeElementString("Lng_Vrsn", "1");
//                        writeComEntityWithoutCDATA(xmlWriterWithoutCDATA);
//                        xmlWriterWithoutCDATA.writeStartElement("FILE_LIST_PACK");
//                        xmlWriterWithoutCDATA.writeElementString("FILE_NUM", "1");
//                        xmlWriterWithoutCDATA.writeStartElement("FILE_INFO");
//                        xmlWriterWithoutCDATA.writeElementString("FILE_NAME", BatchFileServerName);
//                        xmlWriterWithoutCDATA.writeElementString("Msg_Smy", md5(FileContent.toString(), "GBK"));//MD5
//                        xmlWriterWithoutCDATA.writeEndDocument();
//
//                        int n = xmlWriterWithoutCDATA.toXmlString().length();
//                        xmlLength = decimalFormat.format(n);
//
//                        writeCommonHeader(xmlWriter);
//                        xmlWriter.writeStartElement("request");
//
////                        txCode = "P1CMSER43";
//                        txCode = "P1CLP1051";
//                        reqSeqID = p_req9108.singleDetail.askNumber;
//                        //写入通用的头部节点
//                        writeCommonHeaderWithoutCDATA(xmlWriterWithoutCDATA);
//                        xmlWriterWithoutCDATA.writeStartElement("request");
//                        xmlWriter.writeElementCDATA("Txn_SN", p_req9108.singleDetail.askNumber);
//                        xmlWriter.writeElementCDATA("EBnk_SvAr_ID", CustNo);
//                        xmlWriter.writeElementCDATA("Entrst_Prj_ID", projectID);//钞汇代码 1钞人民币 2汇外币
//                        xmlWriter.writeElementCDATA("Prj_Use_ID", projectUseId);
//                        xmlWriter.writeElementCDATA("EtrUnt_AccNo", p_req9108.singleDetail.recAct);
//                        xmlWriter.writeElementCDATA("TDP_ID", opertorID);
//                        xmlWriter.writeElementCDATA("TDP_Nm", "");
//                        xmlWriter.writeElementCDATA("CntprtAcc", p_req9108.singleDetail.payAct);
//                        xmlWriter.writeElementCDATA("Cntrprt_AccNm", p_req9108.singleDetail.payName);
//                        xmlWriter.writeElementCDATA("IwBk_BrNo", "");
//                        xmlWriter.writeElementCDATA("IwBk_BkNm", "");
//                        xmlWriter.writeElementCDATA("MltltAgrm_No", "");
//                        xmlWriter.writeElementCDATA("CCY_ID", "156");
//                        xmlWriter.writeElementCDATA("Orig_File_Nm", BatchFileName);
//                        xmlWriter.writeElementCDATA("SRP_TxnAmt", amount + "");
//                        xmlWriter.writeElementCDATA("SCSP_Smy_Dsc", "");
//                        xmlWriter.writeElementCDATA("Rvw_Ind", "1");
//                        xmlWriter.writeElementCDATA("TAmt", amount + "");
//                        xmlWriter.writeElementCDATA("TDnum", "1");
//                        xmlWriter.writeElementCDATA("VCHR_TP_CODE", "0");
//                        xmlWriter.writeElementCDATA("Lng_Vrsn", "1");
//                        writeComEntity(xmlWriter);
//                        xmlWriter.writeStartElement("FILE_LIST_PACK");
//                        xmlWriter.writeElementCDATA("FILE_NUM", "1");
//                        xmlWriter.writeStartElement("FILE_INFO");
//                        xmlWriter.writeElementCDATA("FILE_NAME", BatchFileServerName);
//                        xmlWriter.writeElementCDATA("Msg_Smy", md5(FileContent.toString(), "GBK"));//MD5
//                        xmlWriter.writeEndDocument();
//                        String[] tmpStrRet = sendToBank(xmlWriter.toXmlString());
//                        if (tmpStrRet[0].length() == 0) {
//
//                            StringBuilder tmpSbMsg = new StringBuilder();
//                            XmlTextReader tmpBkReader = null;
//                            tmpBkReader = getBankInfo(tmpStrRet[1], tmpSbMsg);
//                            String xln_status = tmpBkReader.getFirstText("/Transaction/Transaction_Header/SYS_TX_STATUS"); // 服务状态
//                            String xln_resp_code = tmpBkReader.getFirstText("/Transaction/Transaction_Header/SYS_RESP_CODE"); // 服务响应码
//                            String xln_resp_desc = tmpBkReader.getFirstText("/Transaction/Transaction_Header/SYS_RESP_DESC"); // 服务响应描述
//                            if (IsResultInvlid(tmpStrRet[1], tmpBkReader, false, retAts)) {
//                                if (tmpBkReader != null) {
//                                    //SYS_TX_STATUS 服务状态 00-成功01-失败02-不确
//                                    String tmpStatus = tmpBkReader.getFirstText("/Transaction/Transaction_Header/SYS_TX_STATUS");
//                                    //100-不确定,200-待复核,300-复核不通过,400-复核完毕,待账务系统处理,401-复核完毕,待发送账务系统,
//                                    // 500-已收回,600-已删除(直连单据复核不通过时状态置为600),700-交易成功,800-交易失败,901-账务系统成功已接收,
//                                    // 902-账务系统检核完毕,903-账务系统下账,904-账务系统处理完成,429-单笔跨行终审成功,待人行处理
//                                    String tmpCode = tmpBkReader.getFirstText("/Transaction/Transaction_Body/response/Vchr_St");
//                                    String tmpResponseStatus = tmpBkReader.getFirstText("/Transaction/Transaction_Header/tran_response/status");
//                                    if (tmpResponseStatus != null && tmpResponseStatus.equals("FAIL")) {
//                                        detail.respCode = "0";
//                                        detail.transState = tmpStatus + "+" + tmpResponseStatus;
//                                        detail.payInfoCode = detail.transState;
//                                        String tmpResponseCode = tmpBkReader.getFirstText("/Transaction/Transaction_Header/tran_response/code");
//                                        String tmpResponseDesc = tmpBkReader.getFirstText("/Transaction/Transaction_Header/tran_response/desc");
//                                        detail.respInfo = "状态：" + tmpResponseStatus + ",银行状态码：" + tmpResponseCode + ",原因：" + tmpResponseDesc;
//                                        detail.reqSeqID = p_req9108.singleDetail.askNumber;
//                                    } else {
//                                        detail.respCode = "0";
//                                        detail.transState = tmpStatus + "+" + tmpCode;
//                                        detail.payInfoCode = detail.transState;
//                                        detail.respInfo = tmpBkReader.getFirstText("/Transaction/Transaction_Body/response/RDsc");
//                                        detail.reqSeqID = p_req9108.singleDetail.askNumber;
//                                    }
//                                } else {
//                                    detail.respCode = "-1";
//                                    detail.respInfo = tmpSbMsg.toString();
//                                    //retAts.writeRespCode("-1");
//                                    //retAts.writeRespInfo(tmpSbMsg.toString());
//                                }
//                            } else {
//                                detail.respCode = "-1";
//                                detail.respInfo = xln_status + xln_resp_code + xln_resp_desc;
//                                //retAts.writeRespCode("-1");
//                                //retAts.writeRespInfo(xln_status + xln_resp_code + xln_resp_desc);
//                            }
//                        } else {
//                            detail.respCode = "-1";
//                            detail.respInfo = tmpStrRet[1];
//                            //retAts.writeRespCode("-1");
//                            //retAts.writeRespInfo(tmpStrRet[1]);
//                        }
//                    } else {
//                        detail.respCode = "-1";
//                        detail.respInfo = "签到失败";
//                        //retAts.writeRespCode("-1");
//                        //retAts.writeRespInfo("签到失败");
//                    }
//                } else {
//                    detail.respCode = "-1";
//                    detail.respInfo = "下载银行pub密钥失败";
//                    //retAts.writeRespCode("-1");
//                    //retAts.writeRespInfo("下载银行pub密钥失败");
//                }
//            } else {
//                detail.respCode = "-1";
//                detail.respInfo = "下载银行3des密钥失败";
//                //retAts.writeRespCode("-1");
//                //retAts.writeRespInfo("下载银行3des密钥失败");
//            }
//        } catch (Exception e) {
//            detail.respCode = "-1";
//            detail.respInfo = e.getMessage();
//            //retAts.writeRespCode("-1");
//            //retAts.writeRespInfo(e.getMessage());
//            e.printStackTrace();
//        }
//        retAts.writeRetDetail(detail);
//        //retAts.writeEnd();
//        return retAts;
//    }
//
//    @Override
//    public RetAtsSingle d_9144_QryRealTimeRec(ReqQrySingle p_req9144) throws Exception {
//        RetAtsSingle retAts = new RetAtsSingle(p_req9144.reqHeader);
//        RetAtsSglDetail detail = new RetAtsSglDetail();
//        //retAts.writeStart();
//
//        try {
//            getBnkToken();
////            if (triDesKeys != null && triDesKeys.length != 1024) {
//            if (StringHelper.hasAnyChar(bankFront.token)) {
//                if (new File(String.format("%1$s%2$s_BnkPubKey.txt", strtmpFile, bankFront.org)).exists()) {
//                    if (!"".equals(bankFront.loginFlag) && !"false".equals(bankFront.loginFlag)) {
//                        String EachPageNum = getBankConfig().getValueAsString("EachPageNum");
//                        int pageNum = Integer.parseInt(EachPageNum);
//                        int totalPage = 1 / pageNum;
//                        if (Integer.parseInt("1") % pageNum != 0) {
//                            totalPage++;
//                        }
//                        //region
//                        for (int i = 1; i <= totalPage; i++) {
//                            txCode = "P1CLP1055";
//                            reqSeqID = p_req9144.askNumber;
//                            page = i + "";
//                            String CustNo = bankFront.org;
//                            XmlTextWriter xmlWriter = new XmlTextWriter();//发银行报文的XML对象
//                            XmlTextWriter xmlWriterWithoutCDATA = new XmlTextWriter();//发银行报文的XML对象
//                            //写入通用的头部节点
//                            writeCommonHeaderWithoutCDATA(xmlWriterWithoutCDATA);
//                            xmlWriterWithoutCDATA.writeStartElement("request");
//                            xmlWriterWithoutCDATA.writeElementString("Txn_SN", reqSeqID);
//                            xmlWriterWithoutCDATA.writeElementString("EBnk_SvAr_ID", CustNo);
//                            xmlWriterWithoutCDATA.writeElementString("EtrUnt_ID", "");
//                            xmlWriterWithoutCDATA.writeElementString("VchID", "");
//                            xmlWriterWithoutCDATA.writeElementString("Ret_Rslt_Cd", "1");
//                            xmlWriterWithoutCDATA.writeElementString("Fmt_File_TpCd", "");
//                            writeComEntityWithoutCDATA(xmlWriterWithoutCDATA);
//                            xmlWriterWithoutCDATA.writeEndDocument();
//                            int n = xmlWriterWithoutCDATA.toXmlString().length();
//                            xmlLength = decimalFormat.format(n);
//
//                            writeCommonHeader(xmlWriter);
//                            xmlWriter.writeStartElement("request");
//                            xmlWriter.writeElementCDATA("Txn_SN", reqSeqID);
//                            xmlWriter.writeElementCDATA("EBnk_SvAr_ID", CustNo);
//                            xmlWriter.writeElementCDATA("EtrUnt_ID", "");
//                            xmlWriter.writeElementCDATA("VchID", "");
//                            xmlWriter.writeElementCDATA("Ret_Rslt_Cd", "1");
//                            xmlWriter.writeElementCDATA("Fmt_File_TpCd", "");
//                            writeComEntity(xmlWriter);
//                            xmlWriter.writeEndDocument();
//
//                            String[] tmpStrRet = sendToBank(xmlWriter.toXmlString());
//
//                            if (tmpStrRet[0].length() == 0) {
//
//                                detail.respCode = "0";
//                                StringBuilder tmpSbMsg = new StringBuilder();
//                                XmlTextReader tmpBkReader = null;
//                                tmpBkReader = getBankInfo(tmpStrRet[1], tmpSbMsg);
//                                String xln_status = tmpBkReader.getFirstText("/Transaction/Transaction_Header/SYS_TX_STATUS"); // 服务状态
//                                String xln_resp_code = tmpBkReader.getFirstText("/Transaction/Transaction_Header/SYS_RESP_CODE"); // 服务响应码
//                                String xln_resp_desc = tmpBkReader.getFirstText("/Transaction/Transaction_Header/SYS_RESP_DESC"); // 服务响应描述
//                                if (IsResultInvlid(tmpStrRet[1], tmpBkReader, false, retAts)) {
//                                    if (tmpBkReader != null) {
//                                        //SYS_TX_STATUS 服务状态 00-成功01-失败02-不确
//                                        String tmpStatus = tmpBkReader.getFirstText("/Transaction/Transaction_Header/SYS_TX_STATUS");
//                                        String tmpCode = tmpBkReader.getFirstText("/Transaction/Transaction_Body/response/Vchr_St");
//                                        detail.respCode = "0";
//                                        detail.transState = tmpStatus + "+" + tmpCode;
//                                        detail.payInfoCode = detail.transState;
//                                        detail.respInfo = tmpBkReader.getFirstText("/Transaction/Transaction_Body/response/RDsc");
//                                        detail.reqSeqID = tmpBkReader.getFirstText("/Transaction/Transaction_Body/response/Txn_SN");
//                                    } else {
//                                        detail.respCode = "-1";
//                                        detail.respInfo = tmpSbMsg.toString();
//                                        //retAts.writeRespCode("-1");
//                                        //retAts.writeRespInfo(tmpSbMsg.toString());
//                                    }
//                                } else if (xln_status.equals("01") && xln_resp_code.equals("YCEP30285302") && xln_resp_desc.equals("[ERRORCODE=YCEP30285302] [根据客户序列号找不到对应的凭证，请检查客户序列号是否正确]")) {
//                                    detail.transState = xln_status + "+" + xln_resp_code;
//                                    detail.payInfoCode = xln_resp_desc;
//                                    detail.reqSeqID = p_req9144.askNumber;
//                                    detail.respCode = "0";
//                                    detail.respInfo = xln_resp_desc;
//                                } else {
//                                    detail.respCode = "-1";
//                                    detail.respInfo = xln_status + xln_resp_code + xln_resp_desc;
//                                    //retAts.writeRespCode("-1");
//                                    //retAts.writeRespInfo(xln_status + xln_resp_code + xln_resp_desc);
//                                }
//                            } else {
//                                detail.respCode = "-1";
//                                detail.respInfo = tmpStrRet[1];
//                                //retAts.writeRespCode("-1");
//                                //retAts.writeRespInfo(tmpStrRet[1]);
//                            }
//                        }
//                        //endregion
//                    } else {
//                        detail.respCode = "-1";
//                        detail.respInfo = "签到失败";
//                        //retAts.writeRespCode("-1");
//                        //retAts.writeRespInfo("签到失败");
//                    }
//
//                } else {
//                    detail.respCode = "-1";
//                    detail.respInfo = "下载银行pub密钥失败";
//                    //retAts.writeRespCode("-1");
//                    //retAts.writeRespInfo("下载银行pub密钥失败");
//                }
//            } else {
//                detail.respCode = "-1";
//                detail.respInfo = "下载银行3des密钥失败";
//                //retAts.writeRespCode("-1");
//                //retAts.writeRespInfo("下载银行3des密钥失败");
//            }
//
//        } catch (Exception ex) {
//            detail.respCode = "-1";
//            detail.respInfo = ex.getMessage();
//            ex.printStackTrace();
//        }
//        retAts.writeRetDetail(detail);
//        retAts.writeEnd();
//        return retAts;
//    }
//}
